home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / prog / pbwiz17.zip / VGADEMO.BAS < prev    next >
BASIC Source File  |  1993-06-05  |  3KB  |  94 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |         PBWIZ  Copyright (c) 1991-1993  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      PowerBASIC Wizard's Library                     |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    $DIM ARRAY
  10.  
  11.    DECLARE SUB GetDisplay (INTEGER, INTEGER)
  12.    DECLARE SUB G13Box (INTEGER, INTEGER, INTEGER, INTEGER, INTEGER)
  13.    DECLARE SUB G13Color (INTEGER, INTEGER)
  14.    DECLARE SUB G13Locate (INTEGER, INTEGER)
  15.    DECLARE SUB G13Mode (INTEGER)
  16.    DECLARE SUB G13Polygon (INTEGER, INTEGER, INTEGER, INTEGER, SINGLE)
  17.    DECLARE SUB G13Write (STRING)
  18.    DECLARE SUB G13WriteLn (STRING)
  19.    DECLARE SUB GN0Cls ()
  20.    DECLARE SUB GN0Color (INTEGER, INTEGER)
  21.    DECLARE SUB GN0Locate (INTEGER, INTEGER)
  22.    DECLARE SUB GN0Mode (INTEGER)
  23.    DECLARE SUB GN0ShowBMP (STRING, INTEGER, INTEGER, INTEGER)
  24.    DECLARE SUB GN0Write (STRING)
  25.    DECLARE SUB GN0WriteLn (STRING)
  26.  
  27.    $LINK "pbwiz.pbl"
  28.  
  29.    DEFINT A-Z
  30.  
  31.    RANDOMIZE TIMER
  32.  
  33.    GetDisplay Adapter, Mono
  34.  
  35.    IF Adapter <> 6 THEN
  36.       PRINT "Sorry.  VGADEMO requires a VGA to run."
  37.       END
  38.    END IF
  39.  
  40.    G13Mode 1                 ' ...put into low-res VGA mode
  41.    G13Color 4, 2
  42.    G13WriteLn "PBWiz gives you access to 256-color VGA"
  43.    G13Color 0, 3
  44.    G13WriteLn "modes from  320x200 to 360x480  on any "
  45.    G13Color 7, 1
  46.    G13WriteLn "standard VGA.   This is 320x200.   The "
  47.    G13Color 5, 8
  48.    G13WriteLn "360x480 mode is shown on the next page."
  49.    G13WriteLn ""
  50.    G13Color 4, 14
  51.    G13WriteLn "Full text & graphics support included. "
  52.    FOR Y = 0 TO 31
  53.       G13Color Y + 16, 0
  54.       G13Box Y, Y + 64, 319 - Y, (64 - Y) + 120, (Y = 100)
  55.       IF Y > 15 THEN
  56.          G13Polygon Y * 15 - 194, 112, 5, INT(RND * 6 + 1) + 2, .75 * 3.141593
  57.          G13Color 64 - Y, 0
  58.          G13Polygon Y * 15 - 194, 136, 5, INT(RND * 6 + 1) + 2, 0
  59.       END IF
  60.    NEXT
  61.    G13Locate 25, 14
  62.    G13Color 15, 4
  63.    G13Write "Press any key"
  64.  
  65.    DO
  66.    LOOP WHILE LEN(INKEY$)
  67.    DO
  68.       ky$ = INKEY$
  69.    LOOP UNTIL LEN(ky$)
  70.  
  71.    GN0Mode 1
  72.  
  73.    GN0Cls
  74.    GN0Color 50, 0
  75.    GN0WriteLn "This is a 256-color 360 x 480 graphics mode"
  76.    GN0WriteLn "which works on any normal VGA.  It provides"
  77.    GN0WriteLn "nearly 3x the screen area of the standard"
  78.    GN0WriteLn "320 x 200  VGA high-color mode."
  79.    GN0WriteLn ""
  80.    GN0WriteLn "You can read and write Windows bitmaps"
  81.    GN0WriteLn "(.BMP picture files) in 256 colors, too."
  82.  
  83.    GN0ShowBMP "GDEMO.BMP", 76, 100, ErrCode
  84.  
  85.    GN0Locate 60, 6
  86.    GN0Write "Press any key"
  87.  
  88.    DO
  89.    LOOP WHILE LEN(INKEY$)
  90.    DO
  91.    LOOP UNTIL LEN(INKEY$)
  92.  
  93.    GN0Mode 0                 ' restore text mode
  94.